package com.catl.plc.utils;

import com.catl.plc.handler.ModbusEntity;

import java.util.Collection;
import java.util.Map;

/**
 * @Description TODO
 * @ClassName CollectionUtils
 * @Date 2022/1/27 11:33
 * @Author 王东平
 */
public abstract class CollectionUtils {
    public CollectionUtils() {
    }

    public static boolean isEmpty(Collection<?> collection) {
        return collection == null || collection.isEmpty();
    }

    public static boolean isEmpty(Map<?, ?> map) {
        return map == null || map.isEmpty();
    }


    /**
     * @Description TODO
     * @ClassName ClassWrapper
     * @Date 2022/1/18 9:49
     * @Author 王东平
     */
    public static class ClassWrapper {
        private Class<? extends ModbusEntity> clazz;

        public Class<? extends ModbusEntity> getClazz() {
            return clazz;
        }

        public void setClazz(Class<? extends ModbusEntity> clazz) {
            this.clazz = clazz;
        }

        public ClassWrapper() {

        }

        public ClassWrapper(Class<? extends ModbusEntity> clazz) {
            this.clazz = clazz;
        }
    }
}
